This repository has been archived by the owner on Jun 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
get CRD by discovery mechanism instead of get plural #261
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
wonderflow
commented
Oct 22, 2020
•
edited
Loading
edited
- use discovery mechanism to discovery definition name by using CRD name fix [Feature] Using K8s Discovery mechanism to get resource from GVK #202
- refactor the test, it's mass and I fixed them by refactoring.
wonderflow
force-pushed
the
fix-d
branch
2 times, most recently
from
October 23, 2020 02:44
652249b
to
05fc9db
Compare
Signed-off-by: 天元 <[email protected]>
Signed-off-by: 天元 <[email protected]>
Signed-off-by: 天元 <[email protected]>
wonderflow
force-pushed
the
fix-d
branch
10 times, most recently
from
October 24, 2020 02:09
ebb47ac
to
358d876
Compare
Why is the build module changed? Is that even supposed to be checked-in? |
@@ -230,35 +238,23 @@ func PassLabelAndAnnotation(parentObj oam.Object, childObj labelAnnotationObject | |||
// the format of the definition of a resource is <kind plurals>.<group> | |||
// Now the definition name of a resource could also be defined as `definition.oam.dev/name` in `metadata.annotations` | |||
// typeLabel specified which Definition it is, if specified, will directly get definition from label. | |||
func GetDefinitionName(u *unstructured.Unstructured, typeLabel string) string { | |||
func GetDefinitionName(dm discoverymapper.DiscoveryMapper, u *unstructured.Unstructured, typeLabel string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's kinda late to change but it seems that it is better to make the dm a public variable in the package inside the init() function? In this way, we don't need to pass this around, all the caller of the utility functions shouldn't need to create a DiscoveryMapper. This is a pubic utility function that is actually used by other repros, this can break cross repo dependency.
Signed-off-by: 天元 <[email protected]>
ryanzhang-oss
approved these changes
Oct 25, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.